<template>
<div class="basic-setting-content pl16 pr16">
    <!--添加门店-->
    <div class="common-form">{{$t('setting.mall_settings')}}</div>
    <el-form-item :label="$t('setting.delivery_methods')">
      <el-checkbox-group v-model="form.deliveryType">
        <el-checkbox
          v-for="(item, index) in allType"
          :label="item.value"
          :key="index"
          >{{item.name}}</el-checkbox
        >
      </el-checkbox-group>
      <div class="tips">{{$t('setting.delivery_methods_note')}}</div>
    </el-form-item>
    <el-form-item
      :label="$t('setting.mall_logo')"
      :rules="[{  required: true,  message: ' '}]"
      prop="name"
    >
      <div class="ww100">
        <el-button @click="chooseImg('logoUrl')">{{$t('setting.select_image')}}</el-button>
      </div>
      <img class="mt10" v-img-url="form.logoUrl" :width="100" />
      <div class="gray9">{{$t('setting.logo_size_tip')}}</div>
    </el-form-item>
    <div class="common-form">{{$t('setting.tencent_map_key_settings')}}</div>
    <el-form-item :label="$t('setting.tencent_map_key')">
      <el-input v-model.trim="form.txKey" class="max-w460 mr10"></el-input>
      <a
        href="https://lbs.qq.com/console/mykey.html?console=mykey"
        target="_blank"
        >{{$t('setting.tencent_map_key_apply')}}</a
      >
      <div class="tips">
        <p>{{$t('setting.map_key_usage')}}</p>
      </div>
    </el-form-item>
    <div class="common-form">{{$t('setting.logistics_api')}}</div>
    <el-form-item
      :label="$t('setting.kuaidi100_customer')"
      :rules="[{  required: true,  message: ' '}]"
      prop="kuaiDi100.customer"
    >
      <el-input
        v-model.trim="form.kuaiDi100.customer"
        placeholder=""
        class="max-w460"
      ></el-input>
      <div class="tips"> {{$t('setting.kuaidi100_usage')}}
<el-link
          :underline="false"
          href="https://www.kuaidi100.com/openapi/"
          target="_blank"
          type="primary"
          >{{$t('setting.kuaidi100_apply')}}</el-link
        >
      </div>
    </el-form-item>
    <el-form-item :label="$t('setting.kuaidi100_secret')" prop="kuaiDi100.secret">
      <el-input
        v-model.trim="form.kuaiDi100.secret"
        placeholder=""
        class="max-w460"
      ></el-input>
      <div class="tips"> {{$t('setting.kuaidi100_order_usage')}}
<el-link
          :underline="false"
          href="https://www.kuaidi100.com/openapi/"
          target="_blank"
          type="primary"
          >{{$t('setting.kuaidi100_apply')}}</el-link
        >
      </div>
    </el-form-item>
    <el-form-item
      :label="$t('setting.kuaidi100_key')"
      :rules="[{  required: true,  message: ' '}]"
      prop="kuaiDi100.key"
    >
      <el-input
        v-model.trim="form.kuaiDi100.key"
        placeholder=""
        class="max-w460"
      ></el-input>
    </el-form-item>
    <div class="common-form">{{$t('setting.log_recording')}}</div>
    <el-form-item :label="$t('setting.enable_log_recording')" prop="customer">
      <el-checkbox v-model="form.isGetLog">{{$t('setting.record_log')}}</el-checkbox>
      <div class="tips">{{$t('setting.log_volume_tip')}}</div>
    </el-form-item>
    <!--上传图片-->
    <Upload
      v-if="isupload"
      :isupload="isupload"
      :type="type"
      :config="{  total: 1}"
      @returnImgs="returnImgsFunc"
    >
    </Upload>
  </div>
</template>

<script>
import Upload from "@/components/file/Upload.vue";
export default {
  components: {
    Upload
  },
  data() {
    return {
      /*是否打开图片选择*/
      isupload: false,
      type: ""
    };
  },
  props: ["allType"],
  inject: ["form"],
  created() {},
  methods: {
    /*选择图片*/
    chooseImg(e) {
      this.type = e;
      this.isupload = true;
    },
    /*关闭选择图片*/
    returnImgsFunc(e) {
      this.isupload = false;
      if (e != null && e.length > 0) {
        if (this.type == "logoUrl") {
          this.form.logoUrl = e[0].filePath;
        }
      }
    }
  }
};
</script>

<style lang="scss" scoped>
.addCustom_content {
  margin-top: 20px;

  .custom_box {
    margin-bottom: 10px;
  }
}

.addCustomBox {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--prev-color-primary);

  .btn {
    cursor: pointer;
    width: max-content;
    background-color: rgba(64, 149, 229, 1);
    color: rgba(255, 255, 255, 1);
  }
}

.titTip {
  display: inline-bolck;
  font-size: 12px;
  line-height: 24px;
  font-weight: 400;
  color: #999999;
}

.addfont {
  display: inline-block;
  font-size: 12px;
  font-weight: 400;
  color: #4095e5;
  margin-left: 14px;
  cursor: pointer;
}
</style>

